local zhengbing = fk.CreateSkill {
  name = "zhengbing",
}

zhengbing:addEffect("active", {
  anim_type = "drawcard",
  card_num = 1,
  target_num = 0,
  prompt = "#zhengbing",
  times = function(self,player)
    return player.phase == Player.Play and 3 - player:usedSkillTimes(self.name, Player.HistoryPhase) or -1
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) < 3
  end,
  card_filter =function (self, player, to_select, selected)
    return #selected == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local name = Fk:getCardById(effect.cards[1]).trueName
    room:recastCard(effect.cards, player, self.name)
    if player.dead then return end
    if name == "slash" then
      room:addPlayerMark(player, MarkEnum.AddMaxCardsInTurn, 2)
    elseif name == "jink" then
      player:drawCards(1, self.name)
    elseif name == "peach" then
      room:changeKingdom(player, "wei", true)
    end
  end,
})

return zhengbing